package com.sgb.kjwl.di.power;

import com.sgb.kjwl.repository.PowerRepertory;
import com.sgb.kjwl.repository.impl.PowerRepertoryImpl;
import com.sgb.kjwl.view.ui.activity.power.PowerActivity;
import com.sgb.kjwl.view.ui.activity.power.PowerListActivity;
import com.sgb.kjwl.view.ui.activity.power.PowerListActivity3;
import com.sgb.kjwl.viewmodel.power.PowerDetailModel;
import com.sgb.kjwl.viewmodel.power.PowerListModel;
import com.sgb.kjwl.viewmodel.power.PowerListModel3;
import com.swgk.core.base.di.Activity;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class PowerModule {
    private PowerActivity activity;
    private PowerListActivity powerListActivity;
    private PowerListActivity3 powerListActivity3;

    public PowerModule(PowerActivity activity) {
        this.activity = activity;
    }

    public PowerModule(PowerListActivity powerListActivity) {
        this.powerListActivity = powerListActivity;
    }

    public PowerModule(PowerListActivity3 powerListActivity3) {
        this.powerListActivity3 = powerListActivity3;
    }

    @Provides
    @Activity
    PowerRepertory providePowerRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new PowerRepertoryImpl(apiSource, preferenceSource);
    }

    @Provides
    @Activity
    PowerDetailModel providePowerDetailModel(PowerRepertory repertory) {
        return new PowerDetailModel(activity, repertory);
    }

    @Provides
    @Activity
    PowerListModel providePowerListModel(PowerRepertory repertory) {
        return new PowerListModel(powerListActivity, repertory);
    }

    @Provides
    @Activity
    PowerListModel3 providePowerListModel3(PowerRepertory repertory) {
        return new PowerListModel3(powerListActivity3, repertory);
    }

}
